package com.yfp.client.controller;

import com.yfp.client.domain.ClientIntegral;
import com.yfp.client.service.ClientIntegralService;
import com.yfp.client.util.Response;
import com.yfp.client.util.SecurityUtils;
import com.yfp.common.core.web.controller.BaseController;
import com.yfp.common.core.web.page.TableDataInfo;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Description: 客户
 *
 * @CreateDate: 2024/8/1 15:02
 * @UpdateUser:
 * @UpdateDate: 2024/8/1 15:02
 * @UpdateRemark: 暂无修改
 * @Version: 1.0
 */
@RestController
@RequestMapping("/client/clientIntegral")
@Tag(name = "客户积分")
public class ClientIntegralController extends BaseController {
    @Autowired
    private ClientIntegralService clientIntegralService;

    @Operation(summary = "客户积分-分页列表")
    @GetMapping("/list")
    public Response<TableDataInfo<List<ClientIntegral>>> list() {
        startPage();
        List<ClientIntegral> clientIntegrals = clientIntegralService.getByClientId(SecurityUtils.getClientId());
        return Response.success(getDataTable(clientIntegrals));
    }
}
